<template lang="pug">
  .itemWrapper
    .mediaBox
      img(:src="detail.resURL")
    .detail(@click.stop="()=> routerInfo()")
      h3 {{detail.title}}
      p
        span
          i.mr5(class="el-icon-time")
          | {{item.personNum}}人
        span.ml16
          i.mr5(class="el-icon-time")
          | {{detail.created | dateFilter('YYYY/MM/DD')}}
      el-row(:gutter="20")
        el-col(:span="14")
          user-box(:name="detail.staffName" :img="detail.staffImg")
        el-col(:span="10")
          el-button.gradientVertical(round size="small") 报名预约
    .gradientBtn.tag {{detail.dirTitle}}
</template>
<script>
import UserBox from '@/components/Business/UserBox'

export default {
  components: {
    UserBox
  },
  props: {
    detail: {
      type: Object,
      default: () => ({})
    },
    isMy: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    routerInfo () {
      this.$router.push({
        path: '/educational/courseManage/source/info',
        query: {
          id: this.detail.id
        }
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.itemWrapper{
  position: relative;
  margin-bottom: 30px;
  cursor: pointer;

  .mediaBox {
    position: relative;
    height: 230px;
    background: #fafafa;

    > img {
      width: 100%;
      height: 100%;
    }

    > span {
      position: absolute;
      display: block;
      left: 50%;
      top: 50%;
      z-index: 10;
      transform: translate(-50%, -50%);
      text-align: center;

      i {
        font-size: 56px;
        color: #69b7df
      }
    }
  }

  .detail{
    margin-top: 20px;

    h3 {
      font-size: 17px;
      font-family: PingFang SC;
      font-weight: bold;
      color: #333333;
      line-height: 1;
      margin-top: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      margin-bottom: 10px
    }

    p {
      font-size: 13px;
      font-family: PingFang SC;
      font-weight: 500;
      color: #999999;
      line-height: 1.5;
    }
  }

  footer{
    margin-top: 10px;

    .gradientBtn{
      height: 40px;
    }
  }
}
.tag{
  position: absolute;
  z-index: 10;
  top: 10px;
  left: -10px;
  height: 30px;
  display: inline-block;
  padding: 0 24px;
  line-height: 30px;
  border-top-left-radius: 15px;
  border-bottom-right-radius: 15px;
  color: #fff;
  font-size: 13px;
  font-family: PingFang SC;
}
</style>
